﻿using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;

namespace PmSoft.DBContext
{
    /// <summary>
    ///  日志数据库
    /// </summary>
    [UseDI(ServiceLifetime.Scoped)]
    public class LogDbContext : PetaPocoDbContext
    {
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="optionsAccessor"></param>
        public LogDbContext(IConfiguration configuration)
            : base(new PetaPocoDbContextOptions
            {
                ConnectionString = configuration.GetConnectionString("LogDbConnection") ?? string.Empty,
                ProviderName = "MySQL"
            })
        {
        }
    }
}
